<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="java.util.*" %>
    <%@ page import="model.*" %>
<form name="makeStudyForm" method="post" action="NewAction.Study">
	<div class="container firstDiv">
		<div class="col-md-6 col-md-offset-3">
			<div class="btn-group">
			  	<button type="button" id="categoryMenu"
			  		name="categoryMenu" class="btn btn-default dropdown-toggle"
			  		data-toggle="dropdown">
			  		분야
			  		<span class="caret"></span>
			  	</button>
			  	<ul class="dropdown-menu" role="menu">
			  		<%
			  			ArrayList<Category> list =
			  			(ArrayList<Category>)request.getAttribute("categories");
			  			if(list != null) { for(Category category :
			  			list) {
			  		%>
			  		<li>
			  			<a href="#"
			  				onclick="selectCategory(this, '<%= category.getCateid() %>')">
			  				<%=category.getCategory()%>
			  			</a>
			  		</li>
			  		<%} }%>
			  </ul>
			  <input type="hidden" id="category" name="category" value=""/>
				<div class="input-group">
					<span class="input-group-addon">최대팀원수</span>
					<input type="text" id="memberLimit" name="memberlimit" class="form-control" placeholder="최대 팀원 숫자">
					<span class="input-group-addon">명</span>
				</div>
			</div>
			<div class="input-group">
				<span class="input-group-addon">제목</span>
				<input type="text" id="title" name="title" class="form-control" placeholder="Stduy Name">
			</div>
			<div class="input-group">
				<span class="input-group-addon">내용</span>
				<textarea class="form-control" id="content" name="content" rows="15"></textarea>
			</div>
			<div class="input-group">
				<span class="input-group-addon">보증금</span>
				<select id="deposit" name="deposit" class="form-control">
				<% 
				ArrayList<Deposit> depositList = (ArrayList<Deposit>)request.getAttribute("deposit");
					if(depositList != null) {
						for(Deposit deposit  : depositList) {
				%>				
							<option value='<%= deposit.getDepositId() %>'><%= deposit.getDeposit() %></option>
				<%
						}
					} 
				%>
				</select>
				<span class="input-group-addon">원</span>
			</div>
			<div class="input-group">
				
				<span class="input-group-addon">벌금</span>
				<select id="fine" name="fine" class="form-control">
				
				<% 
				ArrayList<Fine> fineList = (ArrayList<Fine>)request.getAttribute("fine");
					if(fineList != null) {
						for(Fine fine  : fineList) {
				%>				
							<option value='<%= fine.getFineId() %>'><%= fine.getFine() %></option>
				<%
						}
					} 
				%>
				</select>
				<!-- 
				<select id="fine" name="fine" class="form-control">
					<option>500</option>
					<option>1000</option>
					<option>1500</option>
					<option>2000</option>
					<option>2500</option>
				</select> -->
				<span class="input-group-addon">원</span>
			</div>
			<div class="input-group">
				<span class="input-group-addon">스터디종료시간</span>
				<input type="date" id="expiredtime" name="expiredtime" class="form-control">
			</div>
			<p class="text-center">
				<button type="button" class="btn btn-default btn-lg" onclick="checkStudyInfo()">스터디 생성</button>
			</p>
			<p id="message" class="text-center">
			</p>
		</div>
	</div>	
</form>